package com.dba.example.guice.web;

import java.util.HashMap;
import java.util.Map;

import com.dba.example.guice.web.logging.RemoteLoggingServiceImpl;
import com.google.inject.servlet.ServletModule;
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;

public class ExampleServletModule extends ServletModule {

	@Override
	protected void configureServlets() {
		bind(GuiceContainer.class);

		// Set up the logging servlet
		serve("/Example/remote_logging").with(RemoteLoggingServiceImpl.class);

		Map<String, String> initParams = new HashMap<String, String>();
		initParams.put("com.sun.jersey.config.feature.Trace", "true");
		initParams.put("com.sun.jersey.config.property.packages", "com.dba.example.guice.web.rest");

		serve("/rest/*").with(GuiceContainer.class, initParams);
	}

}
